arm/vgic: drop const attribute from gic_iomem_deny_access()
authorRoger Pau Monné <roger.pau@citrix.com>
Thu, 29 Sep 2022 12:41:13 +0000 (14:41 +0200)
committerJan Beulich <jbeulich@suse.com>
Thu, 29 Sep 2022 12:41:13 +0000 (14:41 +0200)
While correct from a code point of view, the usage of the const
attribute for the domain parameter of gic_iomem_deny_access() is at
least partially bogus.  Contents of the domain structure (the iomem
rangeset) is modified by the function.  Such modifications succeed
because right now the iomem rangeset is allocated separately from
struct domain, and hence is not subject to the constness of struct
domain.

Amend this by dropping the const attribute from the function
parameter.

This is required by further changes that will convert
iomem_{permit,deny}_access into a function.

Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
Reviewed-by: Bertrand Marquis <bertrand.marquis@arm.com>
xen/arch/arm/gic-v2.c
xen/arch/arm/gic-v3.c
xen/arch/arm/gic.c
xen/arch/arm/include/asm/gic.h

index bd773bcc672ccd47e1dfc525fa196d92318f738a..ae5bd8e95f299339e84ea9330901d98b78f68d46 100644 (file)
@@ -1083,7 +1083,7 @@ static void __init gicv2_dt_init(void)
     gicv2_extension_dt_init(node);
 }
 
-static int gicv2_iomem_deny_access(const struct domain *d)
+static int gicv2_iomem_deny_access(struct domain *d)
 {
     int rc;
     unsigned long mfn, nr;
index 64b36cec25d0d218fff1976a736e46263d3f8eea..018fa0dfa0260ca88db9d8f468599566703ed551 100644 (file)
@@ -1424,7 +1424,7 @@ static void __init gicv3_dt_init(void)
                               &vbase, &vsize);
 }
 
-static int gicv3_iomem_deny_access(const struct domain *d)
+static int gicv3_iomem_deny_access(struct domain *d)
 {
     int rc, i;
     unsigned long mfn, nr;
index 3b0331b53830f37d4b753d29d4165da0982d6041..9b82325442f51bc090ba35a8394dc94b1001d23b 100644 (file)
@@ -462,7 +462,7 @@ unsigned long gic_get_hwdom_madt_size(const struct domain *d)
 }
 #endif
 
-int gic_iomem_deny_access(const struct domain *d)
+int gic_iomem_deny_access(struct domain *d)
 {
     return gic_hw_ops->iomem_deny_access(d);
 }
index 3692fae3938122d6b724781cf895e1c748f5344c..76e3fa5dc47c7f1865dcdc3bddc0b06949fff353 100644 (file)
@@ -392,7 +392,7 @@ struct gic_hw_operations {
     /* Map extra GIC MMIO, irqs and other hw stuffs to the hardware domain. */
     int (*map_hwdom_extra_mappings)(struct domain *d);
     /* Deny access to GIC regions */
-    int (*iomem_deny_access)(const struct domain *d);
+    int (*iomem_deny_access)(struct domain *d);
     /* Handle LPIs, which require special handling */
     void (*do_LPI)(unsigned int lpi);
 };
@@ -449,7 +449,7 @@ unsigned long gic_get_hwdom_madt_size(const struct domain *d);
 #endif
 
 int gic_map_hwdom_extra_mappings(struct domain *d);
-int gic_iomem_deny_access(const struct domain *d);
+int gic_iomem_deny_access(struct domain *d);
 
 #endif /* __ASSEMBLY__ */
 #endif